# -*- coding: utf8 -*-
from MySQLdb import *
import _mysql
import MySQLdb
import datetime

def conn():
    #conn = MySQLdb.connect(host='localhost',user='root',passwd='760218',db='appfusecore',use_unicode=True,charset='utf8')
    #id = '27'
    #name = 'test1'
    #conn.query('select * from test where id=%s and name="%s"'%(id,name))
    #print conn.character_set_name()
    #r = conn.use_result()
    #rr = conn.store_result()

    #print r.num_rows()
    #ss = r.fetch_row()
    #resultLen = len(ss)

    #for i in range(resultLen):
    #    print ss[i][0],ss[i][1]
    #    print '=========================='

    
    #print conn.get_host_info()
    #print conn.get_server_info()
    #print conn.info()
    
    
    cnt = MySQLdb.connect(host='localhost',user='root',passwd='760218',db='appfusecore',use_unicode=True,charset='utf8')

    charset = cnt.character_set_name()    
    cur = cnt.cursor()
    db = cur._get_db()
    for i in range(9999999):
        name="欧大鹏"+str(datetime.datetime.now());
        cur.execute("insert into restful(name)values('%s')"%name)
        cnt.commit()
        
    print charset    
    #print cnt.get_character_set_info()
    cur.close()
    cnt.close()
    
conn()    
